//
//  MyRewardTableViewCell.m
//  jingjing2.0
//
//  Created by apple on 16/5/22.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "MyRewardTableViewCell.h"

@implementation MyRewardTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        _prizeSourceLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 150, 40)];
        _prizeSourceLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleBottomMargin;
        [self addSubview:_prizeSourceLabel];
        
        _getBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.frame.size.width-90, 0, 80, 40)];
        [_getBtn setTitle:@"立即领取" forState:UIControlStateNormal];
        _getBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin;
        [_getBtn setTitleColor:BLUECOLOR forState:UIControlStateNormal];
        [self addSubview:_getBtn];
        
        UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_prizeSourceLabel.frame), self.frame.size.width, 1)];
        lineView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleWidth;
        lineView.backgroundColor = GRAYCOLOR;
        [self addSubview:lineView];
        
        _prizeNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(lineView.frame), 150, 40)];
        _prizeNameLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleBottomMargin;
        [self addSubview:_prizeNameLabel];
        
        _getTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(_prizeNameLabel.frame), self.frame.size.width -20, 20)];
        _getTimeLabel.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleWidth;
        _getTimeLabel.font = [UIFont systemFontOfSize:14];
        _getTimeLabel.textColor = GRAYCOLOR;
        [self addSubview:_getTimeLabel];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
